package com.ocom.payhandle.controller;

import com.ocom.common.constant.PayHandleUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.ccb.CcbzhshAddUserVo;
import com.ocom.payhandle.service.CcbAccountService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

//2.13建行智慧生活

@RestController
public class CcbAccountController {
    @Resource
    private CcbAccountService ccbAccountService;

    //
    /**
     * 2.13.1 创建用户（ccbzhsh/addUser）
     * @param request
     * @return
     */
    @PostMapping(PayHandleUrl.URL_ccbzhshAddUser)
    public Result ccbzhshAddUser(@RequestBody @Valid CcbzhshAddUserVo request){
        return ccbAccountService.ccbzhshAddUser(request.getComId(), request);
    }

    /**
     * 2.13.2 删除用户（ccbzhsh/deleteUser）
     * @param request
     * @return
     */
    @PostMapping(PayHandleUrl.URL_ccbzhshDeleteUser)
    public Result ccbzhshDeleteUser(@RequestBody @Valid CcbzhshAddUserVo request){
        return ccbAccountService.ccbzhshDeleteUser(request.getComId(),request);
    }
}
